package cn.dengta.webapp.trade.entity;

import java.util.Date;

import cn.dengta.common.model.ValueProxy;
import cn.dengta.common.model.ValueProxyImpl;
import cn.dengta.webapp.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

/**
 * 支付风控录音确认记录
 *
 * @author lizhichao
 * @since 2024-04-01
 */
@Setter
@Getter
@TableName("dt_pay_risk_record_log")
public class PayRiskRecordLog extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/** 用户ID */
	Long userId;
	/** 用户确认内容 */
	String content;
	/** 确认类型：0=语音；1=文字确认 */
	Integer type;
	/** 状态： -1=已拒绝；0=待处理；1=已通过 */
	Integer status;
	/** 拒绝次数 */
	Integer rejectNum;
	/** 新增时间 */
	Date addTime;

	public static final String USER_ID = "user_id";
	public static final String CONTENT = "content";
	public static final String TYPE = "type";
	public static final String STATUS = "status";
	public static final String ADD_TIME = "add_time";
	public static final String REJECT_NUM = "reject_num";

	public Status status() {
		return Status.of(status);
	}

	@Getter
	public enum Status implements ValueProxyImpl<Status, Integer> {
		REJECT(-1, "已拒绝"),
		PENDING(0, "待处理"),
		PASS(1, "已通过");

		public final Integer value;
		public final String label;
		private final ValueProxy<Status, Integer> proxy;

		Status(Integer value, String label) {
			this.value = value;
			this.label = label;
			this.proxy = new ValueProxy<>(this, value, label);
		}

		public static Status of(Integer value) {
			return REJECT.getValueOf(value);
		}
	}

}
